#ifndef GENERATOR_H_
#define GENERATOR_H_

#include "model/board.h"

typedef std::pair<unsigned int, unsigned int> position;

enum Case{
	Empty,
	Island,
	VertSimpleBridge,
	VertDoubleBridge,
	HorizSimpleBridge,
	HorizDoubleBridge
};

enum Direction{
	Up,
	Down,
	Left,
	Right
};

enum BridgeType{
	Simple,
	Double
};

class Generator {
public :
	Generator();
	Case** generate(unsigned int const size);

private :
	Case** genBoard;
	unsigned int size;
	std::vector<position> availableIslands;
	position generateRandomIsland();
	bool canPlaceIslandAt(position pos);
	position selectRandomIsland();
	bool makeBridge(position pos, Direction dir, BridgeType type);
	bool randomContinue();
	bool placeIsland(position pos);
	Direction randomDirection();
	BridgeType randomType();
};

#endif /* GENERATOR_H_ */
